<template>
    <el-tooltip v-if="name" class="item" effect="light" :content="name" placement="top" visible-arrow="false" :enterable="false">
        <span :class="classMap[type]"></span>
    </el-tooltip>
    <span v-else :class="classMap[type]"></span>
</template>

<script>
export default {
    name: 'index',
    //type: 图标样式  name:按钮的名称（tooltip的内容）
    props: ['type', 'name'],
    data() {
        return {
            classMap: {
                copy: 'table-body-copy',
                template: 'table-body-template',
                add: 'table-body-add',
                edit: 'table-body-edit',
                delete: 'table-body-delete',
                more: 'table-body-more',
                view: 'table-body-view',
                exit: 'table-body-exit',
                revoke: 'table-body-revoke',
                sync: 'table-body-sync',
                code: 'table-body-code',
                download: 'table-body-download',
                transfer: 'table-body-transfer',
                export: 'table-body-export',
                preview: 'table-body-preview',
                upload: 'table-body-upload',
                urge: 'table-body-urge',
                return: 'table-body-return',
                gwview: 'table-body-gwview',
                gwdelete: 'table-body-gwdelete',
                gwedit: 'table-body-gwedit',
                gwdownload: 'table-body-gwdownload',
                gwadd: 'table-body-gwadd',
                gweditkuai: 'table-body-editkuai',
                gwdelkuai: 'table-body-delkuai',
                feedback: 'table-body-feedback',
                issue: 'table-body-issue',
                gwyesT: 'table-body-gwyesT',
                gwviewFiles: 'table-body-gwviewFiles',
                gwviewImport: 'table-body-import',
                gwSubmit: 'table-body-gwSubmit',
                print: 'table-body-print',
                gwClose: 'table-body-close',
            },
        }
    },
}
</script>

<style lang="scss" scoped>
.table-body-copy,
.table-body-template,
.table-body-add,
.table-body-edit,
.table-body-delete,
.table-body-more,
.table-body-view,
.table-body-exit,
.table-body-revoke,
.table-body-sync,
.table-body-download,
.table-body-transfer,
.table-body-code,
.table-body-export,
.table-body-preview,
.table-body-upload,
.table-body-urge,
.table-body-return,
.table-body-gwview,
.table-body-gwdelete,
.table-body-gwedit,
.table-body-gwdownload,
.table-body-gwadd,
.table-body-editkuai,
.table-body-delkuai,
.table-body-feedback,
.table-body-issue,
.table-body-gwyesT,
.table-body-gwviewFiles,
.table-body-print,
.table-body-close,
.table-body-gwSubmit {
    display: inline-block;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    cursor: pointer;
}

.table-body-import {
    display: inline-block;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    cursor: pointer;
}
.table-body-print {
    background: url('../../assets/icons/table/print2.png') no-repeat center;
    background-size: 100%;
}
.table-body-copy {
    background: url('../../assets/icons/table/copy.png') no-repeat center;
    background-size: 100%;
}
.table-body-template {
    background: url('../../assets/icons/table/template.png') no-repeat center;
    background-size: 100%;
}
.table-body-import {
    background: url('../../assets/icons/table/LVdownload.png') no-repeat center;
    background-size: 100%;
}
.table-body-add {
    background: url('../../assets/icons/table/add.png') no-repeat center;
    background-size: 100%;
}
.table-body-export {
    background: url('../../assets/icons/table/export.png') no-repeat center;
    background-size: 100%;
}
.table-body-edit {
    background: url('../../assets/icons/table/edit.png') no-repeat center;
    background-size: 100%;
}
.table-body-delete {
    background: url('../../assets/icons/table/delete.png') no-repeat center;
    background-size: 100%;
}
.table-body-more {
    background: url('../../assets/icons/table/more.png') no-repeat center;
    background-size: 100%;
}
.table-body-view {
    background: url('../../assets/icons/table/view.png') no-repeat center;
    background-size: 100%;
}
.table-body-exit {
    background: url('../../assets/icons/table/switch.png') no-repeat center;
    background-size: 100%;
}
.table-body-revoke {
    background: url('../../assets/icons/table/revoke.png') no-repeat center;
    background-size: 100%;
}
.table-body-sync {
    background: url('../../assets/icons/table/sync.png') no-repeat center;
    background-size: 100%;
}
.table-body-code {
    background: url('../../assets/icons/table/code.png') no-repeat center;
    background-size: 100%;
}
.table-body-download {
    background: url('../../assets/icons/table/download.png') no-repeat center;
    background-size: 100%;
}
.table-body-transfer {
    background: url('../../assets/icons/table/transfer.png') no-repeat center;
    background-size: 100%;
}
.table-body-preview {
    background: url('../../assets/icons/table/preview.png') no-repeat center;
    background-size: 100%;
}
.table-body-upload {
    background: url('../../assets/icons/table/upload.png') no-repeat center;
    background-size: 100%;
}
.table-body-urge {
    background: url('../../assets/icons/table/urge.png') no-repeat center;
    background-size: 100%;
}
.table-body-return {
    background: url('../../assets/icons/table/return.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwview {
    background: url('../../assets/icons/table/goldwindview.png') no-repeat
        center;
    background-size: 100%;
}
.table-body-gwdelete {
    background: url('../../assets/icons/table/gwdelete.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwedit {
    background: url('../../assets/icons/table/gwedit.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwdownload {
    background: url('../../assets/icons/table/LVdownload.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwadd {
    background: url('../../assets/icons/table/addgw.png') no-repeat center;
    background-size: 100%;
}
.table-body-editkuai {
    background: url('../../assets/icons/table/editkuai.png') no-repeat center;
    background-size: 100%;
}
.table-body-delkuai {
    background: url('../../assets/icons/table/delkuai.png') no-repeat center;
    background-size: 100%;
}
.table-body-feedback {
    background: url('../../assets/icons/table/feedback.png') no-repeat center;
    background-size: 100%;
}
.table-body-issue {
    background: url('../../assets/icons/table/issue.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwyesT {
    background: url('../../assets/icons/table/gwyesT.png') no-repeat center;
    background-size: 18px 18px;
}
.table-body-gwviewFiles {
    background: url('../../assets/icons/table/viewFiles.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwSubmit {
    background: url('../../assets/icons/table/submit.png') no-repeat center;
    background-size: 100%;
}
.table-body-add:hover {
    background: url('../../assets/icons/table/add-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-copy:hover {
    background: url('../../assets/icons/table/copy-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-template:hover {
    background: url('../../assets/icons/table/template-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-export {
    background: url('../../assets/icons/table/export.png') no-repeat center;
    background-size: 100%;
}
.table-body-edit {
    background: url('../../assets/icons/table/edit.png') no-repeat center;
    background-size: 100%;
}
.table-body-delete {
    background: url('../../assets/icons/table/delete.png') no-repeat center;
    background-size: 100%;
}
.table-body-more {
    background: url('../../assets/icons/table/more.png') no-repeat center;
    background-size: 100%;
}
.table-body-view {
    background: url('../../assets/icons/table/view.png') no-repeat center;
    background-size: 100%;
}
.table-body-exit {
    background: url('../../assets/icons/table/switch.png') no-repeat center;
    background-size: 100%;
}
.table-body-revoke {
    background: url('../../assets/icons/table/revoke.png') no-repeat center;
    background-size: 100%;
}
.table-body-sync {
    background: url('../../assets/icons/table/sync.png') no-repeat center;
    background-size: 100%;
}
.table-body-code {
    background: url('../../assets/icons/table/code.png') no-repeat center;
    background-size: 100%;
}
.table-body-download {
    background: url('../../assets/icons/table/download.png') no-repeat center;
    background-size: 100%;
}
.table-body-transfer {
    background: url('../../assets/icons/table/transfer.png') no-repeat center;
    background-size: 100%;
}
.table-body-preview {
    background: url('../../assets/icons/table/preview.png') no-repeat center;
    background-size: 100%;
}
.table-body-upload {
    background: url('../../assets/icons/table/upload.png') no-repeat center;
    background-size: 100%;
}
.table-body-urge {
    background: url('../../assets/icons/table/urge.png') no-repeat center;
    background-size: 100%;
}
.table-body-return {
    background: url('../../assets/icons/table/return.png') no-repeat center;
    background-size: 100%;
}
.table-body-close {
    background: url('../../assets/icons/table/close.png') no-repeat center;
    background-size: 100%;
}
.table-body-add:hover {
    background: url('../../assets/icons/table/add-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-edit:hover {
    background: url('../../assets/icons/table/edit-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-delete:hover {
    background: url('../../assets/icons/table/delete-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-more:hover {
    background: url('../../assets/icons/table/more-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-view:hover {
    background: url('../../assets/icons/table/view-p.png') no-repeat center;
    background-size: 100%;
}

.table-body-exit:hover {
    background: url('../../assets/icons/table/switch-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-revoke:hover {
    background: url('../../assets/icons/table/revoke-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-sync:hover {
    background: url('../../assets/icons/table/sync-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-code:hover {
    background: url('../../assets/icons/table/code-p.png') no-repeat center;
    background-size: 100%;
}

.table-body-download:hover {
    background: url('../../assets/icons/table/download-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-export:hover {
    background: url('../../assets/icons/table/export-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-transfer:hover {
    background: url('../../assets/icons/table/transfer-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-preview:hover {
    background: url('../../assets/icons/table/preview-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-upload:hover {
    background: url('../../assets/icons/table/upload-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-urge:hover {
    background: url('../../assets/icons/table/urge-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-return:hover {
    background: url('../../assets/icons/table/return-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwview:hover {
    background: url('../../assets/icons/table/goldwindview-p.png') no-repeat
        center;
    background-size: 100%;
}
.table-body-gwdelete:hover {
    background: url('../../assets/icons/table/gwdelete-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwedit:hover {
    background: url('../../assets/icons/table/gwedit-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwdownload:hover {
    background: url('../../assets/icons/table/LVdownload-p.png') no-repeat
        center;
    background-size: 100%;
}
.table-body-gwadd:hover {
    background: url('../../assets/icons/table/addgw-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-editkuai:hover {
    background: url('../../assets/icons/table/editkuai-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-delkuai:hover {
    background: url('../../assets/icons/table/delkuai-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-feedback:hover {
    background: url('../../assets/icons/table/feedback-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-issue:hover {
    background: url('../../assets/icons/table/issue-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwyesT:hover {
    background: url('../../assets/icons/table/gwyesT-p.png') no-repeat center;
    background-size: 17px 17px;
}
.table-body-gwviewFiles:hover {
    background: url('../../assets/icons/table/viewFiles-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-gwSubmit:hover {
    background: url('../../assets/icons/table/submit-p.png') no-repeat center;
    background-size: 100%;
}
.table-body-print:hover {
    background: url('../../assets/icons/table/print1.png') no-repeat center;
    background-size: 100%;
}
.table-body-close:hover {
    background: url('../../assets/icons/table/close-p.png') no-repeat center;
    background-size: 100%;
}
</style>
